package com.yt.order.api.utils;

public class OrderConstants {
	public static enum OrderStatus {
		Navigate("负的平衡记录", "n"),
		AgentOrder("代理商新添加订单", "-2"),
		Disabled("订单已取消", "-1"),
		NewOrder("订单已添加", "0"), // 所有提交订单，包括代理商和亿康
		Send("订单已发送", "1"), // 订单已发送给合作商家
		Confirmed("订单已确认", "2");// 合作商家已经确认
		private String statusValue;
		private String status;

		OrderStatus(String status, String statusValue) {
			this.status = status;
			this.statusValue = statusValue;
		}

		public String getStatusValue() {
			return this.statusValue;
		}

		public String getStatus() {
			return this.status;
		}

		public static String getStatusName(String statusValue) {
			if (statusValue != null) {
				if (statusValue.equals(NewOrder.getStatusValue())) {
					return NewOrder.getStatus();
				} else if (statusValue.equals(Send.getStatusValue())) {
					return Send.getStatus();
				} else if (statusValue.equals(Confirmed.getStatusValue())) {
					return Confirmed.getStatus();
				} else if (statusValue.equals(Disabled.getStatusValue())) {
					return Disabled.getStatus();
				} else if (statusValue.equals(AgentOrder.getStatusValue())) {
					return AgentOrder.getStatus();
				}
			}
			return "";
		}
	}

	// 预约状态
	public static enum ReservationStatus {
		New("0", "未发送"), // 新
		Sent("1", "已发送"), // 已发送
		ReSent("2", "再次发送"), // 重新发送
		Canceled("3", "已撤销"); // 已取消

		public String value;
		public String status;

		ReservationStatus(String value, String status) {
			this.value = value;
			this.status = status;
		}

		public static String getStatusByValue(String value) {
			for (ReservationStatus status : ReservationStatus.values()) {
				if (status.value.equals(value)) {
					return status.status;
				}
			}
			return "";
		}
	}

	// 预约确认状态
	public static enum ReservationConfirmed {
		Yes("1", "已确认"), Not("0", "未确认");
		public String value;
		public String status;

		ReservationConfirmed(String value, String status) {
			this.value = value;
			this.status = status;
		}

		public static String getStatusByValue(String value) {
			for (ReservationConfirmed status : ReservationConfirmed.values()) {
				if (status.value.equals(value)) {
					return status.status;
				}
			}
			return "";
		}
	}

	//发票状态
	public static enum InvoiceStatus {
		AgentNotSend("-2", "未提交"),        //代理商新增未提交的发票
		New("0", "未发送"),                    //代理商新提交的发票和公司内部新增的发票
		Sent("1", "已发送"),                    //发送到合作商家的发票
		Declare("3", "已上报"),                //合作商家已经上报的发票
		Complete("2", "已开票");                //已开并邮寄的发票
		public String value;
		public String status;

		InvoiceStatus(String value, String status) {
			this.value = value;
			this.status = status;
		}

		public static String getStatusByValue(String value) {
			for (ReservationConfirmed status : ReservationConfirmed.values()) {
				if (status.value.equals(value)) {
					return status.status;
				}
			}
			return "";
		}
	}

	public static enum InstitutionType {
		PUBLIC(1, "公立"),
		PRIVATE(0, "私立");
		public int value;
		public String name;

		InstitutionType(int value, String name) {
			this.value = value;
			this.name = name;
		}

		public static String getNameByValue(int value) {
			for (InstitutionType v : InstitutionType.values()) {
				if (v.value == value) {
					return v.name;
				}
			}
			return "";
		}
	}


	//订单来源
	public static enum OrderFrom {
		INTERNAL("内部", 0),
		Agent("代理商", 1),
		APP("APP", 2);
		private String fromName;
		private int value;

		OrderFrom(String fromName, int value) {
			this.fromName = fromName;
			this.value = value;
		}

		public String getFromName() {
			return fromName;
		}

		public void setFromName(String fromName) {
			this.fromName = fromName;
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}
	}

	//订单类型
	public static enum OrderType {
		Group("团体订单", 0),
		Single("个人订单", 1);
		private String typeName;
		private int type;

		OrderType(String typeName, int type) {
			this.typeName = typeName;
			this.type = type;
		}

		public String getTypeName() {
			return typeName;
		}

		public void setTypeName(String typeName) {
			this.typeName = typeName;
		}

		public int getType() {
			return type;
		}

		public void setType(int type) {
			this.type = type;
		}
	}

}
